#ifndef PI_H
#define PI_H

#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <cassert>
#include <sstream>
#include <vector>
#include <map>
#include <assert.h>

using namespace std;

enum EDGE_TYPE {VOLTVIA, METALVIA, CS, NORMAL};


typedef struct SpMtrDt_{
        int x;
        int y;
        double val;
}SpMtrDt;


typedef struct point3d_{
        int x;
        int y;
        int z;
        void operator=(const point3d_ p2){
                x = p2.x;
                y = p2.y;
                z = p2.z;
        };
        bool operator<(const point3d_ p2) const{
                if(z < p2.z)
                        return true;
                else if(z > p2.z)
                        return false;
                else if(x < p2.x)
                        return true;
                else if(x > p2.x)
                        return false;
                else
                        return (y < p2.y);
        };
        bool operator!=(const point3d_ p2) const{
                return(x != p2.x || y != p2.y || z != p2.z);
        }
        bool operator==(const point3d_ p2) const{
                return((x == p2.x) && (y == p2.y) && (z == p2.z));
        };
}point3d;


class Edge{
  public:
        std::string name;
        point3d beg_pnt;
        point3d end_pnt;
        double res;
        EDGE_TYPE et;
};


class Node{
  public:
        point3d pnt;
        std::vector<Edge> ne;
};


class Graph{
  public:
        long numNodes;
        long numEdges;
        //unsigned long x_grid;
        //unsigned long y_grid;
        //std::vector<Node> nodes;
        std::map<point3d, std::vector<Edge> > nodes;
        std::map<point3d, double> vs;
        std::map<point3d, double> cs;
};

int my_atof(const char *str, double *pnumber);
//int get3DEdgeID(const point3d p1, const point3d p2, routingInst *rst);
//int getPoints3D(int edgeID, point3d &p1, point3d &p2, routingInst *rst);

#endif // PI_H
